home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue70 / Clinic / COMSolution1 / ComClass2Impl.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-05  |  558 b   |  30 lines

  1. unit ComClass2Impl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ActiveX, Classes, ComObj, ComServer2_TLB, StdVcl,
  7.   BaseLib_TLB;
  8.  
  9. type
  10.   TComClass2 = class(TTypedComObject, IFoo)
  11.   protected
  12.     procedure Bar; safecall;
  13.     {Declare IComClass2 methods here}
  14.   end;
  15.  
  16. implementation
  17.  
  18. uses
  19.   ComServ, Dialogs;
  20.  
  21. procedure TComClass2.Bar;
  22. begin
  23.   ShowMessage('Hello from an instance of TComClass2 in ComServer2.dll')
  24. end;
  25.  
  26. initialization
  27.   TTypedComObjectFactory.Create(ComServer, TComClass2, Class_ComClass2,
  28.     ciMultiInstance, tmApartment);
  29. end.
  30.